import useFormInput from "../useFormInput";

const Demo6 = () => {
  const firstName = useFormInput("John");
  const lastName = useFormInput("Doe");

  const handleSubmit = (event) => {
    event.preventDefault();
    alert(`Submitting Name: ${firstName.value} ${lastName.value}`);
  };

  return (
    <div className="ProviderContainer BrownBorder">
      <h1>useFormInput</h1>
      <form onSubmit={handleSubmit}>
        <input type="text" {...firstName} />
        <input type="text" {...lastName} />
        <button type="submit">Submit</button>
      </form>
    </div>
  );
};

export default Demo6;
